<?php
/**
 * polwebgis
 * 
 * This file is part of polwebgis.
 *
 * @copyright   Copyright (c) 2012 Dominik Janisch (http://www.joanneum.at)
 * @lastmodified    $LastChangedDate: 2012-03-07 09:15:12 +0000 (Wed, 07 Mar 2012) $
 * @revision    $Revision: 160 $ 
 */

require_once(PATH_TO_APP . "/interfaces/MapInterface.php");

class Map
{       
    protected $is_wms_ = false;
    protected $output_handler_;
    protected $request_;
    protected $map_;
    protected $singleton_registry_;
    protected $database_connection_;
    protected $table_gateway_;
    protected $session_;
    protected $table_details_;
    protected $session_name_;
    protected $language_handler_;
    
        
    protected function createMap()
    {
        ms_resetErrorList();
        $image = $this->map_->draw();
        $error = ms_getErrorObj();
        $error_list = '';
        while($error && $error->code != MS_NOERR && $error->routine != 'msPostGISRetrievePgVersion()')
        {
            if($this->request_->issetParameter('get', 'debug'))
                echo "Error in ".$error->routine.": ".$error->message."\n";
            $error_list .= date("d.m.y H:i:s") . ": Error in ".$error->routine.": ".$error->message."\n";
            $error = $error->next();
        }
        if(strlen($error_list) > 0)
            file_put_contents('logs/map_erors.txt', $error_list, FILE_APPEND);
        return $image;
    }
}

?>
